<%= form_for(@target_question_box) do |f| %>
  <% if @target_question_box.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@target_question_box.errors.count, "error") %> prohibited this target_question_box from being saved:</h2>

      <ul>
      <% @target_question_box.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :section_id %><br />
    <%#= f.number_field :section_id %>
    <%= collection_select(:target_question_box, :section_id, Section.all, :id, :title) %>
  </div>
  <div class="field">
    <%= f.label :control_group_id %><br />
    <%#= f.number_field :control_group_id %>
    <%= collection_select(:target_question_box, :control_group_id, ControlGroup.all, :id, :title) %>
  </div>
  <div class="field">
    <%= f.label :candidate_id %><br />
    <%#= f.number_field :target_id %>
    <%= collection_select(:target_question_box, :candidate_id, Candidate.all, :id, :name) %>
  </div>
  <div class="field">
    <%= f.label :org_id %><br />
    <%#= f.number_field :target_id %>
    <%= collection_select(:target_question_box, :org_id, Org.all, :id, :name) %>
  </div>
  <div class="field">
    <%= f.label :target_resource %><br />
    <%= select(:target_question_box, :target_resource, [['单位', 'org'], ['候选人', 'candidate']]) %>
    <%#= f.text_field :target_resource %>
  </div>
  <div class="field">
    <%= f.label :question_id %><br />
    <%#= f.number_field :question_id %>
    <%= collection_select(:target_question_box, :question_id, Question.all, :id, :text) %>
  </div>
  <div class="field">
    <%= f.label :showquestion %><br/>
    <%= f.check_box :showquestion %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
